home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / boot / initrd.img-2.6.28-15-generic / initrd.img-2.6 / scripts / casper-bottom / 40install_driver_updates < prev    next >
Encoding:
Text File  |  2009-10-12  |  739 b   |  43 lines

  1. #! /bin/sh
  2.  
  3. PREREQ=""
  4. DESCRIPTION="Installing driver updates..."
  5.  
  6. . /scripts/casper-functions
  7.  
  8. prereqs()
  9. {
  10.        echo "$PREREQ"
  11. }
  12.  
  13. case $1 in
  14. # get pre-requisites
  15. prereqs)
  16.        prereqs
  17.        exit 0
  18.        ;;
  19. esac
  20.  
  21. if [ ! -d /tmp/driver-updates ]; then
  22.     exit 0
  23. fi
  24.  
  25. log_begin_msg "$DESCRIPTION"
  26.  
  27. install_dir=/var/cache/driver-updates
  28.  
  29. mkdir "/root$install_dir"
  30. cp -a /tmp/driver-updates/*.deb "/root$install_dir/"
  31.  
  32. # We cannot leave packages in a bad state. So if the install fails, remove
  33. # it. This will get caught in casper.log.
  34. for deb in "/root$install_dir"/*; do
  35.     [ -f "$deb" ] || continue
  36.     debbase="${deb##*/}"
  37.     if ! chroot /root dpkg -i "$install_dir/$debbase"; then
  38.         chroot /root dpkg -P "${debbase%%_*}"
  39.     fi
  40. done
  41.  
  42. log_end_msg
  43.